<template>
	<view class="">
		<uni-nav-bar :statusBar="true" :border="false">
			 <view slot="left" class="title">
				 消息
			 </view>
			<view slot="right" class="right">
				<image src="../../../static/jiahao.png" class="" mode=""></image>
			</view>
		</uni-nav-bar>
		
		
		
		<view class="ROW JUSB search CENT">
			
			<view class="search_row">
				<view class="CENT">
					<image src="../../../static/shousuo.png"  mode=""></image>
					
				</view>
				<view class="CENT FLEX_1">
					<input type="text" value="" placeholder="搜索消息" />
				</view>
				
			</view>
			
		</view>
		
		
	
		
		<view class="ROW UPDW meassage">
			<view v-if="false" class="new_row CENT" >
				<view class="CENT img_row" style="">
					<image src="../../../static/x01.png" mode=""></image>
					<view class="jiaobiao">
						6
					</view>
				</view>
				<view class="text UPDW LIFE JUSB">
					<view class="text_top">
						审批
					</view>
					<view class="text_dw">
						你有一条待审批信息
					</view>
				</view>
			</view>
			
			
			<view v-if="false" class="new_row CENT" >
				<view class="CENT img_row" style="">
					<image src="../../../static/x02.png" mode=""></image>
					<view v-if="false"  class="jiaobiao">
						6
					</view>
				</view>
				<view class="text UPDW LIFE JUSB">
					<view class="text_top">
						项目消息
					</view>
					<view class="text_dw">
						你有一条新的项目消息请查看
					</view>
				</view>
			</view>
			
			
			<view class="new_row CENT" @click="toNotification()">
				<view class="CENT img_row" style="">
					<image src="../../../static/x03.png" mode=""></image>
					<view v-if="logListLength>0" class="jiaobiao">
						{{logListLength}}
					</view>
				</view>
				<view class="text UPDW LIFE JUSB">
					<view class="text_top">
						日报信息
					</view>
					<view class="text_dw">
						你有一条新的日报信息请查看
					</view>
				</view>
			</view>
			
			
			
			<view v-if="false" class="new_row CENT" >
				<view class="CENT img_row" style="">
					<image src="../../../static/x04.png" mode=""></image>
					<view v-if="false" class="jiaobiao CENT">
						6
					</view>
				</view>
				<view class="text UPDW LIFE JUSB">
					<view class="text_top">
						业务消息
					</view>
					<view class="text_dw">
						你有一条新的业务消息
					</view>
				</view>
			</view>
			<!-- <view class="new_row CENT">
				<view v-for="(log,index) in logList" class="" :key="index">
					{{log}}
				</view>
			</view> -->
		</view>
	</view>
</template>

<script>
	
// import mqttObject from '@/mqtt/mqtt-connect-clent.js';

var _this;

export default {
	data() {
		return {
			list:[
				{
					icon:''
				}
			],
			logList:[],
		};
	},
	onLoad() {
		_this = this;		
		_this.logList = uni.getStorageSync('logList')
		this.$store.state.logLength = _this.logList.length;
		console.log(this.$store.getters.getLogLength)
	},
	computed:{
		logListLength(){
			return this.$store.getters.getLogLength;
		}
	},
	methods: {
		subscribe(){
			console.log("subscribe enter")
			_this.$mqtt.mqttsubscribe(mqttsubscribe)
		},
		publish(){
			_this.$mqtt.mqttpublish('hello','setr=can see you\n');
		},
		callback(loglist){
			console.log("initMqtt callback enter")
			this.logList = loglist;
		},
		toNotification(){
			this.$utils.navto('../../notification/notification')
		}
	}
};
</script>

<style scoped lang="scss" >
.title{
	font-size: 38rpx;
}
.right{
	image{
		height: 36rpx;
		width: 36rpx;
	}
}

.search{
	margin-top:32rpx ;
	height: 60rpx;
	padding:0 32rpx ;
	.search_row{
		width: 100%;
		background:#f7f7f7 ;
		border-radius:30rpx ;
		padding-left: 25rpx;
	}
	image{
		height: 27rpx;
		width: 27rpx;
		margin-right: 20rpx;
	}
	input{
		width: 100%;
	}
}
.meassage{
	margin-top: 32rpx;
	flex-direction: column;
	width: 100%;
}
.new_row{
	border-bottom:1rpx solid #eeeeee ;
	width: 100%;
	box-sizing: border-box;
	padding: 25rpx 30px;
	height: 140rpx;
	.img_row{
		position: relative;
		width: 100rpx;
	}
	image{
		height: 90rpx;
		width: 90rpx;
	}
	.text{
		margin-left: 30rpx;
		width: 100%;
		.text_top{
			font-size: 30rpx;
			color: #454545;
		}
		.text_dw{
			font-size: 24rpx;
			color: #909090;
		}
	}
	.jiaobiao{
		font-size: 12px;
		color: #FFFFFF;
		border: 1rpx solid #FFFFFF;
		background: red;
		padding: 0rpx 14rpx;
		right: -20rpx;
		top: 40rpx;
		border-radius: 50%;
		position: absolute;
	}
	
}
</style>
